{% extends 'home/home.html' %}
{% block index %}
{% load static %}

<div class="uk-section" style="padding: 20px;">
    <div class="uk-container">
        <h3 class="uk-heading-small uk-text-center">
            <font style="vertical-align: inherit;">
                <font style="vertical-align: inherit;">临时共享</font>
            </font>
        </h3>
        {% if username %}
        <div class="uk-text-right">
            <a href="./up" class="uk-button uk-button-primary uk-margin-small-left uk-border-pill uk-text-large">上传</a>
        </div>
        {% endif %}
        <hr
            style="height: 2px;padding: 0;border: none;text-align: center;background-image: linear-gradient(to right, rgba(60, 122, 198, 0), rgba(6, 58, 122, 1), rgba(60, 122, 198, 0));" />
    </div>
</div>

{% if sharelist %}
{% for files in sharelist %}
<h3 class="uk-text-center">
    {{ files.0.2 }}
    <hr>
</h3>
<div class="uk-section uk-section-muted" style="min-height: 200px;padding: 10px;">
    <div class="uk-container">
        <div class="uk-child-width-1-1 uk-child-width-1-4@m uk-grid" uk-grid="">
            {% for file in files %}
            <div class="uk-first-column">
                <div class="uk-card uk-card-default tm-image-card uk-text-center" style="height: 150px;">
                    <div class="uk-card-body uk-text-break">
                        <h3 class="uk-card-title uk-text-warning" style="font-size: 16px;font-weight: bolder;">{{ file.0 }}</h3>
                        <p class=" uk-text-primary">
                            <a href="/{{ file.1 }}" class="uk-text-success" download="{{ file.2 }}">下载</a>
                            {% if superuser %}
                            <a href="/delete/{{ file.1 }}" class="uk-text-danger"> 删除</a>
                            {% endif %}
                        </p>
                    </div>
                </div>
            </div>
            {% endfor %}
        </div>
    </div>
</div>
{% endfor %}
{% else %}
<p>这里空无一人。</p>
{% endif %}
{% endblock %}